package com.zxl.admin.controller.member;

import com.github.pagehelper.PageInfo;
import com.zxl.common.Page;
import com.zxl.common.Result;
import com.zxl.common.model.query.member.MemberListQuery;
import com.zxl.common.model.vo.member.MemberListVo;
import com.zxl.common.service.SysMemberService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zxw
 * @date 2023/4/1
 */
@Api(tags = "小程序用户")
@RestController
@RequestMapping("/admin/member")
public class MemberController {
    @Resource
    private SysMemberService sysMemberService;

    @ApiOperation("会员列表")
    @GetMapping("/select")
    public Result<Page<MemberListVo>> selectMemberList(MemberListQuery memberListQuery){
        List<MemberListVo> memberListVos = sysMemberService.selectMemberList(memberListQuery);
        Page<MemberListVo> page = Page.pageInfoConvert(new PageInfo(memberListVos));
        return new Result(page);
    }
}
